$(function() {
    $('#userRequireModal').on('shown.bs.modal', function (e) {  
        $(this).find('.modal-dialog').css({  
            'margin-top': function () {  
                var modalHeight = $(this).height();  
                $(this).show();
                console.log($(document.body).height());
                console.log(modalHeight);
                return  ($(window).height() / 2)-($(this).find("#requireform").height()/2);  
            }  
        });      
    });  
	scrollScreen();
	getTechList(false, 1);
	$('#msgId').empty();
	// 选择硬智汇介绍
	$('.content-cover').hover(function() {
		$(this).find('.content-icon i').toggleClass('active');
	});
	$('#submitBtn').click(function(){
		var data = $('#requireform').serialize();
		$.ajax({
	        type : 'POST',
	        url : SERVER_PATH + '/user/v1/submitRequire?t=1&'+data,
	        async:false,
	        success : function(res){
	        	if(res.rescode==100){
	        		alert("提交成功，等待反馈");
	        		$('#userRequireModal').modal('hide')
	        		$('#requireform')[0].reset();
	        		$('#msgId').empty();
	        	} else {
	        		$('#msgId').html(res.msg);
	        	}
	        	
	        }
		});
	});
	$('#homeEnter').click(function(){
		window.open(SERVER_PATH + "/toHomeEnter");
	});
});
//滚动，改变分辨率，移除大字体，图标样式
$(window).resize(function() {
	removeAllLarge();
});

$(window).scroll(scrollScreen);

function scrollScreen(){
	var height = $(window).scrollTop();
	var width = $(window).width();
	if (height > 10) {
		removeLarge();
	} else if (height == 0 && width > 769) {
		addLarge();
	}
}

